package cn.kgc.service.impl;

import cn.kgc.dao.GoodsDetailMapper;
import cn.kgc.pojo.GoodsDetail;
import cn.kgc.service.GoodsDetailService;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;
import java.util.List;
@Service
public class GoodsDetailServiceImpl implements GoodsDetailService {
    @Resource
    private GoodsDetailMapper goodsDetailMapper;
    @Override
    public List<GoodsDetail> queryAllDetail(Integer sortId) {
        return goodsDetailMapper.queryAllDetail(sortId);
    }
    @Override
    public GoodsDetail shopGoodsDetailById(Integer id) {
        return goodsDetailMapper.shopGoodsDetailById(id);
    }

    @Override
    public int buy(Integer id, Integer buyNum) {
        return goodsDetailMapper.buy(id,buyNum);
    }
}
